package cdms.domain;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 

* <p>Title: Sender</p>  

* <p>Description: </p>  

* @author zhangxuhao  

* @date Nov 20, 2019
 */
public class Sender {
	
	private Long id;
	
	@NotNull
	@Size(min = 5, max = 20)
	private String userName;
	
	@NotNull
	@Size(min = 5, max = 20)
	private String password;
	
	@NotNull
	@Size(min = 2, max = 30)
	private String fullname;
	
	
	private boolean isDelete;
	
	@NotNull
	@Size(min = 11, max = 11)
	private String phoneNo;
	
	private boolean isOnline;
	
	

	public Sender(Long id, String userName, String password, String fullname, boolean isDelete, String phoneNo, boolean isOnline) {
		super();
		this.id = id;
		this.userName = userName;
		this.password = password;
		this.fullname = fullname;
		this.isDelete = isDelete;
		this.phoneNo = phoneNo;
		this.isOnline = isOnline;
	}

	public Sender() {
		super();
	}

	/**
	
	 * @return the id  
	
	 */
	public Long getId() {
		return id;
	}

	/**
	
	 * @param id the id to set  
	
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	
	 * @return the userName  
	
	 */
	public String getUserName() {
		return userName;
	}

	/**
	
	 * @param userName the userName to set  
	
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}

	/**
	
	 * @return the password  
	
	 */
	public String getPassword() {
		return password;
	}

	/**
	
	 * @param password the password to set  
	
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	
	 * @return the fullname  
	
	 */
	public String getFullname() {
		return fullname;
	}

	/**
	
	 * @param fullname the fullname to set  
	
	 */
	public void setFullname(String fullname) {
		this.fullname = fullname;
	}

	
	/**
	
	 * @return the isDelete  
	
	 */
	public boolean isDelete() {
		return isDelete;
	}

	/**
	
	 * @param isDelete the isDelete to set  
	
	 */
	public void setDelete(boolean isDelete) {
		this.isDelete = isDelete;
	}

	/**
	
	 * @return the phoneNo  
	
	 */
	public String getPhoneNo() {
		return phoneNo;
	}

	/**
	
	 * @param phoneNo the phoneNo to set  
	
	 */
	public void setPhoneNo(String phoneNo) {
		this.phoneNo = phoneNo;
	}
	
	/**
	 * @return the isOnline
	 */
	public boolean isOnline() {
		return isOnline;
	}

	/**
	 * @param isOnline the isOnline to set
	 */
	public void setOnline(boolean isOnline) {
		this.isOnline = isOnline;
	}

	/* (non-Javadoc)  
	
	 * <p>Title: hashCode</p>  
	
	 * <p>Description: </p>  
	
	 * @return  
	
	 * @see java.lang.Object#hashCode()  
	
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((fullname == null) ? 0 : fullname.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + (isDelete ? 1231 : 1237);
		result = prime * result + ((password == null) ? 0 : password.hashCode());
		result = prime * result + ((phoneNo == null) ? 0 : phoneNo.hashCode());
		result = prime * result + ((userName == null) ? 0 : userName.hashCode());
		return result;
	}

	/* (non-Javadoc)  
	
	 * <p>Title: equals</p>  
	
	 * <p>Description: </p>  
	
	 * @param obj
	 * @return  
	
	 * @see java.lang.Object#equals(java.lang.Object)  
	
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Sender other = (Sender) obj;
		if (fullname == null) {
			if (other.fullname != null)
				return false;
		} else if (!fullname.equals(other.fullname))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (isDelete != other.isDelete)
			return false;
		if (password == null) {
			if (other.password != null)
				return false;
		} else if (!password.equals(other.password))
			return false;
		if (phoneNo == null) {
			if (other.phoneNo != null)
				return false;
		} else if (!phoneNo.equals(other.phoneNo))
			return false;
		if (userName == null) {
			if (other.userName != null)
				return false;
		} else if (!userName.equals(other.userName))
			return false;
		return true;
	}

}
